export CONFIG_9P_FS=m
export CONFIG_NET_9P=m
export CONFIG_NET_9P_VIRTIO=m
export CONFIG_FAILOVER=m
export CONFIG_VIRTIO_BLK=m
export CONFIG_DMA_VIRTUAL_CHANNELS=m
export CONFIG_VIRTIO_MMIO=m
export CONFIG_VIRTIO_NET=m
export CONFIG_VIRTIO=m
export CONFIG_NET_FAILOVER=m

obj-m =fs/9p/ net/9p/ net/core/ drivers/dma/ drivers/virtio/ drivers/block/ drivers/net/

ARCH=arm64
CROSS_COMPILE=aarch64-target-linux-gnu-
KERNEL_PATH=/opt/RTOS/${RTOS_VERSION}/arm64le_5.10_ek_preempt_pro/sdk/usr/src/kernel/
MODULE_MAKE=${PWD}
MACRO=ARM64_HI1711_ENABLED
KBUILD_EXTRA_SYMBOLS ?= /opt/hi1711sdk/Module.symvers
KBUILD_CFLAGS += -D${MACRO}
$(info ${KBUILD_CFLAGS})
all:
	make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C ${KERNEL_PATH} M=${MODULE_MAKE} KBUILD_EXTRA_SYMBOLS=${KBUILD_EXTRA_SYMBOLS} modules

clean:
	make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C ${KERNEL_PATH} M=${MODULE_MAKE} clean
